//--求高度(占宽的百分比)--
$(function(){
//	--头部--
	var header = $(window).width()*0.055 + "px";
	$(".case_header").css({"height":header,"line-height":header,"padding-right":header});
	$(window).resize(function(){
		var header = $(window).width()*0.055 + "px";
		$(".case_header").css({"height":header,"line-height":header,"padding-right":header});
	});
	
//	--banner区--
	var banner = $(window).width()*0.15 + "px";
	$(".case_banner").css("height",banner);
	$(window).resize(function(){
		var banner = $(window).width()*0.15 + "px";
		$(".case_banner").css("height",banner);
	});
	
	var banner = $(window).width()*0.15 + "px";
	$(".case_banner_left").css({"height":banner,"line-height":banner});
	$(window).resize(function(){
		var banner = $(window).width()*0.15 + "px";
		$(".case_banner_left").css({"height":banner,"line-height":banner});
	});
	
	var banner = $(window).width()*0.15 + "px";
	$(".case_banner_right").css({"height":banner,"line-height":banner});
	$(window).resize(function(){
		var banner = $(window).width()*0.15 + "px";
		$(".case_banner_right").css({"height":banner,"line-height":banner});
	});
	
//	--切换区--
	var cut = $(window).width()*0.125 + "px";
	$(".case_cut").css("height",cut);
	$(window).resize(function(){
		var cut = $(window).width()*0.125 + "px";
		$(".case_cut").css("height",cut);
	});
	
	var cut = $(window).width()*0.125 + "px";
	$(".case_cut1").css({"height":cut,"line-height":cut});
	$(window).resize(function(){
		var cut = $(window).width()*0.125 + "px";
		$(".case_cut1").css({"height":cut,"line-height":cut});
	});
	
	var cut = $(window).width()*0.125 + "px";
	$(".case_cut2").css({"height":cut,"line-height":cut});
	$(window).resize(function(){
		var cut = $(window).width()*0.125 + "px";
		$(".case_cut2").css({"height":cut,"line-height":cut});
	});
	
	var cut = $(window).width()*0.125 + "px";
	$(".case_cut3").css({"height":cut,"line-height":cut});
	$(window).resize(function(){
		var cut = $(window).width()*0.125 + "px";
		$(".case_cut3").css({"height":cut,"line-height":cut});
	});
	
	var box = $(window).width()*0.07 + "px";
	$(".case_box").css({"height":box,"line-height":box});
	$(".case_boxP").css({"height":box,"line-height":box});
	$(".case_boxC").css({"height":box,"line-height":box});

	$(window).resize(function(){
		var box = $(window).width()*0.07 + "px";
		$(".case_box").css({"height":box,"line-height":box});
		$(".case_boxP").css({"height":box,"line-height":box});
		$(".case_boxC").css({"height":box,"line-height":box});
	})
	
	var con = $(window).width() + "px";
	$(".case_cut2CB1_con1").css("width",con);


	$('.con1_des').click(function(){
		$(this).css('color','#fe8949').siblings().css('color','#434343')
	});
});

//--切换区(内容)--
// $(function(){
// 	$(".case_cut1").click(function(){
// 		huifu();
// 		$(this).addClass("case_active");
// 		$(".case_cut2").removeClass("case_active");
// 		$(".case_cut3").removeClass("case_active");
// 		$(".case_cut1_con").css("display","block");
// 		$(".case_cut2_con").css("display","none");
// 		$(".case_cut3_con").css("display","none");
// 	});
//
// 	$(".case_cut2").click(function(){
// 		huifu();
// 		$(this).addClass("case_active");
// 		$(".case_cut1").removeClass("case_active");
// 		$(".case_cut3").removeClass("case_active");
// 		$(".case_cut1_con").css("display","none");
// 		$(".case_cut2_con").css("display","block");
// 		$(".case_cut3_con").css("display","none");
// 	});
//
// 	$(".case_cut3").click(function(){
// 		huifu();
// 		$(this).addClass("case_active");
// 		$(".case_cut2").removeClass("case_active");
// 		$(".case_cut1").removeClass("case_active");
// 		$(".case_cut1_con").css("display","none");
// 		$(".case_cut2_con").css("display","none");
// 		$(".case_cut3_con").css("display","block");
// 	});
//
// });
function setCut(_k){
	huifu();
	$(".case_cut2").removeClass("case_active");
	$(".case_cut1").removeClass("case_active");
	$(".case_cut3").removeClass("case_active");
	$(".case_cut"+_k).addClass("case_active");

	$(".case_cut1_con").css("display","none");
	$(".case_cut2_con").css("display","none");
	$(".case_cut3_con").css("display","none");
	$(".case_cut"+_k+"_con").css("display","block");
}
function huifu(){
	$('.x_show').show();
	$('.x_hide').hide();
	$('.case_box').removeClass("box_active");
	$('.case_cut2CB1_con1').hide();
	
	$('.case_boxP').removeClass("boxP_active");
	
	$('.case_boxC').removeClass("boxC_active");
	
	var box1 = $(window).width()*0.07;
	$(".case_box").css({"margin-bottom":"6px","height":box1+"px"});
	var boxP1 = $(window).width()*0.07;
	$(".case_boxP").css({"margin-bottom":"6px","height":boxP1+"px"});
	var boxC1 = $(window).width()*0.07;
	$(".case_boxC").css({"margin-bottom":"6px","height":boxC1+"px"});
	
}

//--点击弹DIV（创意设计）—--
//		--有三级菜单的--
		function set(i){
			$('.zhu_case_hide').hide();
			$("#_show" + i).toggle().parent().parent().siblings().children().children("img.x_show").show();
			$("#_hide" + i).toggle().parent().parent().siblings().children().children("img.x_hide").hide();
			$('#zhu'+i).show();
		}
		
		$(function(){
	//		--无三级菜单--
			$(".case_box1").click(function(){
				$(this).siblings().children().children("img.x_show").show();
				$(this).siblings().children().children("img.x_hide").hide();
			});


			$(".case_box").click(function(){


				var box1 = $(window).width()*0.07;
				box2 = box1 + 7;
				box3 = box2 + "px";

				var zhi=$(this).attr("onclick");
				if(zhi.indexOf("setFilter")<0){
					$(this).toggleClass("box_active").siblings().removeClass("box_active");
					if($("div[data-a='"+zhi+"']").css("display")=='block'){
						$('.zhu_case_hide').hide();
						$("div[data-a='"+zhi+"']").css({"display":"none"});
						$(this).css({
							"margin-bottom":"6px",
							"height":box1+'px',
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					}else{
						$(".case_box1").css("color","#434343");
						$(".case_cut2CB1_con1").hide();
						$("div[data-a='"+zhi+"']").toggle().siblings().hide();
						$(this).css({
							"margin-bottom":"0",
							"height":box3,
							'border-bottom-right-radius':'0px',
							'border-bottom-left-radius':'0px'
						}).siblings("div.case_box").css({
							"margin-bottom":"6px",
							"height":box1+"px",
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					};
				}else{
					$(".case_box1").css("color","#434343");
					$(this).css('color','#fe8949').siblings().removeClass("box_active");
					$(".case_cut2CB1_con1").hide();
					$(".case_box").css({"margin-bottom":"6px","height":box1+"px"});
				}

			});
		});



//--点击弹DIV（品牌管理）—--

//		--有三级菜单的--
		function setP(i){
			$('.zhu_case_hide').hide();
			$("#x_showP").toggle();
			$("#x_hideP").toggle();
			$('#zhuP'+i).show();
		}

		$(function(){
		//		--无三级菜单--
			$(".case_boxP1").click(function(){
				$(this).siblings().children().children("img#x_showP").show();
				$(this).siblings().children().children("img#x_hideP").hide();
			});


			$(".case_boxP").click(function(){
				var boxP1 = $(window).width()*0.07;
					boxP2 = boxP1 + 7;
					boxP3 = boxP2 + "px";

				var zhi=$(this).attr("onclick");
				// alert(zhi.indexOf("setFilter")>=0);
				if(zhi.indexOf("setFilter")<0){
					$(this).toggleClass("boxP_active").siblings().removeClass("boxP_active");
					if($("div[data-a='"+zhi+"']").css("display")=='block'){
						$('.zhu_case_hide').hide();
						$("div[data-a='"+zhi+"']").css({"display":"none"});
						$(this).css({
							"margin-bottom":"6px",
							"height":boxP1+'px',
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					}else{
						$(".case_boxP1").css("color","#434343");
						$(".case_cut2CB1_con1").hide();
						$("div[data-a='"+zhi+"']").toggle().siblings().hide();
						$(this).css({
							"margin-bottom":"0",
							"height":boxP3,
							'border-bottom-right-radius':'0px',
							'border-bottom-left-radius':'0px'
						}).siblings("div.case_box").css({
							"margin-bottom":"6px",
							"height":boxP1+"px",
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					}
				}else{
					$(".case_boxP1").css("color","#434343");
					$(this).css('color','#fe8949').siblings().removeClass("boxP_active");
					$(".case_cut2CB1_con1").hide();
					$(".case_boxP").css({"margin-bottom":"6px","height":boxP1+"px"});
				}
			});
		});


//--点击弹DIV（传播执行）—--
//		--有三级菜单的--
	function setC(i){
		$('.zhu_case_hide').hide();
		$("#x_showC").toggle();
		$("#x_hideC").toggle();
		$('#zhuC'+i).show();
	}

	$(function(){
		//		--无三级菜单--
		$(".case_boxC1").click(function(){
			$(this).siblings().children().children("img#x_showC").show();
			$(this).siblings().children().children("img#x_hideC").hide();
		});

		$(".case_boxC").click(function(){
			var boxC1 = $(window).width()*0.07;
				boxC2 = boxC1 + 7;
				boxC3 = boxC2 + "px";
				var zhi=$(this).attr("onclick");
				if(zhi.indexOf("setFilter")<0){
					$(this).toggleClass("boxC_active").siblings().removeClass("boxC_active");
					if($("div[data-a='"+zhi+"']").css("display")=='block'){
						$('.zhu_case_hide').hide();
						$("div[data-a='"+zhi+"']").css({"display":"none"});
						$(this).css({
							"margin-bottom":"6px",
							"height":boxC1+'px',
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					}else{
						$(".case_boxC1").css("color","#434343");
						$(".case_cut2CB1_con1").hide();
						$("div[data-a='"+zhi+"']").toggle().siblings().hide();
						$(this).css({
							"margin-bottom":"0",
							"height":boxC3,
							'border-bottom-right-radius':'0px',
							'border-bottom-left-radius':'0px'
						}).siblings("div.case_boxC").css({
							"margin-bottom":"6px",
							"height":boxC1+"px",
							'border-bottom-right-radius':'4px',
							'border-bottom-left-radius':'4px'
						});
					};
				}else{
					$(".case_boxC1").css("color","#434343");
					$(this).css('color','#fe8949').siblings().removeClass("boxC_active");
					$(".case_cut2CB1_con1").hide();
					$(".case_boxC").css({"margin-bottom":"6px","height":boxC1+"px"});
				}

		});

	});
